import cv2
import numpy as np

a = np.array([
    [0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 1, 0, 0, 0],
    [0, 1, 1, 1, 1, 1, 0],
    [0, 1, 0, 1, 0, 1, 0],
    [0, 1, 1, 1, 1, 1, 0],
    [0, 0, 0, 1, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0]
]).astype(np.uint8) * 255

# 对上述的单通道（二维矩阵）进行放大
a = cv2.resize(a, (200, 200))

cv2.imshow("chr", a)
cv2.waitKey(0)
